package njust.csc.aeapi.service

import njust.csc.aeapi.dao.ApkWhitelistRepository
import njust.csc.aeapi.entity.ApkWhiteList
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * @Author ZhouHang
 * @Date 24/8/8 周四
 */
@Service
class ApkWhitelistService @Autowired constructor(
    private val whitelistRepository: ApkWhitelistRepository
) {
    fun findAll(): List<ApkWhiteList> {
        return whitelistRepository.findAll()
    }

    fun saveOrUpdate(apkWhiteList: ApkWhiteList) {
        whitelistRepository.save(apkWhiteList)
    }

    fun delete(id: Int) {
        whitelistRepository.deleteById(id)
    }
}